package cn.xiaochao.zebra;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import cn.xiaochao.mapper.MapperRunner;
import cn.xiaochao.zebra.common.ZKConnectRunner;
import cn.xiaochao.zebra.rpc.RpcClientRunner;
import cn.xiaochao.zebra.rpc.RpcServerRunner;

/**
 * Hello world!
 *
 */
public class EngineStart 
{
    public static void main( String[] args )
    {
        System.out.println( "引擎01启动成功" );
        
        ExecutorService es =Executors.newCachedThreadPool();
        //1.新建zk 并创建节点临时node01，把本地ip和端口写入到节点内容总
        es.submit(new ZKConnectRunner());
        //2.开始任务分块监听
        es.submit(new RpcServerRunner());
        
        es.submit(new MapperRunner());
        //分发map到二级引擎
        es.submit(new RpcClientRunner());

        
        
    }
}
